from rest_framework.views import  APIView
from rest_framework.response import Response
from mycelery.sms.tasks import send_email

class MyCeleryApiView(APIView):

    def get(self,request):
        #异步任务
        # send_email.delay('110')
        # send_email.delay('119')
        #定时任务
        from datetime import datetime
        # from datetime import timedelta
        # ctime=datetime.now()
        # utc_time=datetime.utcfromtimestamp(ctime.timestamp())
        # task_time=utc_time+timedelta(seconds=10)
        # result=send_email.apply_async(['911'],eta=task_time)

        return Response({'result':'ok','result_id':''})